<?php

namespace app\index\controller;

use think\exception\ValidateException;
use app\model\Operatingcity;

class AdminoperatingcityController extends Base
{

    public function detail()
    {
        $uuid = $this->getuuid();
        if (!empty($uuid)) {
            $data = Operatingcity::where(['uuid' => $uuid])->find();
            if (!empty($data)) {
                $data = $data->toArray();
            }
        }

        if ($data['status'] != 1) {
            $data = 0;
            $message = '请先登录！';
        }

        return $this->json(['message' => $message, 'data' => $data]);
    }

    public function check()
    {
        $uuid = $this->getuuid();
        $data = Operatingcity::where(['uuid' => $uuid])->find();
        if ($data) {
            $data = $data->toArray();
        }
        return $this->json(['data' => $data]);
    }
}
